home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
qbbs
/
qkhimsg.zip
/
QKHIMSG.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1990-09-21
|
2KB
|
99 lines
Program QkHiMsg;
Uses Dos, Crt;
type
FlagType = ARRAY[1..4] OF byte;
UserRec = RECORD
Name : string[35];
City : string[25];
Pwd : string[15];
DataPhone,
HomePhone : string[12];
LastTime : string[5];
LastDate : string[8];
Attrib : byte;
Flags : FlagType;
Credit,
Pending,
TimesPosted,
HighMsgRead,
SecLvl,
Times,
Ups,
Downs,
UpK,
DownK,
TodayK,
Elapsed,
Len : integer;
CombinedPtr : word; (* Record number in COMBINED.BBS *)
Age : byte; (* Not yet implemented *)
ExtraSpace : ARRAY[1..5] OF byte;
END;
LastRec = record
UserHiMsg : array[1..200] of integer;
end;
var
LastRead : file of LastRec;
LastVar : LastRec;
TempFile : file of UserRec;
UserFile : file of UserRec;
UserVar : UserRec;
function GetHighMsg(V : LastRec) : integer;
var
x, tmphi : integer;
begin
tmphi := 0;
for x := 1 to 200 do
if V.UserHiMsg[x] > tmphi then tmphi := V.UserHiMsg[x];
GetHighMsg := tmphi;
end;
begin
writeln('QkHiMsg - By Christopher Hall - PC Network (505)821-5341 ');
writeln;
assign(LastRead, 'LastRead.BBS');
{$I-}
reset(LastRead);
{$I+}
if IOResult <> 0 then
begin
writeln('Unable to locate LastRead.BBS file!');
Halt;
end;
assign(UserFile, 'Users.BBS');
{$I-}
reset(UserFile);
{$I+}
if IOResult <> 0 then
begin
writeln('Unable to locate Users.BBS file!');
Halt;
end;
assign(TempFile, 'Users$$$.Tmp');
rewrite(TempFile);
write('Reformatting High Message Read in USERS.BBS - Please Wait..');
while NOT EOF(UserFile) do
begin
read(UserFile, UserVar);
read(LastRead, LastVar);
UserVar.HighMsgRead := GetHighMsg(LastVar);
write(TempFile, UserVar);
end;
close(UserFile);
close(LastRead);
close(TempFile);
rename(UserFile, 'Users.Bak');
rename(TempFile, 'Users.BBS');
writeln;
writeln('Done.');
end.